# Maintainer (Arch): Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Maintainer: Sagar Acharya <sagar@hyperbola.info>

pkgname=python-itsdangerous
pkgver=1.1.0
pkgrel=1
pkgdesc='Various helpers to pass trusted data to untrusted environments'
arch=('any')
url="https://itsdangerous.palletsprojects.com/en/1.1.x/"
license=('Modified-BSD')
depends=('python')
makedepends=('python-setuptools' 'quilt')
source=("$pkgname-$pkgver.tar.gz::https://github.com/pallets/itsdangerous/archive/refs/tags/${pkgver}.tar.gz"
		"series"
		"no-intersphinx-plugin-in-doc.patch")
sha512sums=('6a2c4931050137839bd4ae6847f5f9a4b8b88280a6c2e45192bb8bfd9b2a9e0e997c2fcbdca184d6e110f0765c33155546326875dfb30d58ac064a087a8d948e'
			'453afd0e15cba14c463b0f1bc7d008590a7eaab2ef5006d61fb4a4306ff29cbe9a3ffbce48b90c38d88903600ed7f432b2db6371d8838065ce98b159a3d7b2a5'
			'def80a4306dce1d003359c2deb2bab064838cd4ce3a020829cbcdc2bff3becdfb36bacb4fbf930dab0dee7b6b4338a28eb333f8ed84ba575a9bd2fd1463edcfa')

prepare() {
	cd "itsdangerous-$pkgver"

	mkdir ./patches
  	cp ${srcdir}/series ./patches
  	cp ${srcdir}/*.patch ./patches

  	export QUILT_PATCHES=patches
  	export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  	export QUILT_DIFF_ARGS='--no-timestamps'

  	quilt push -av
}

package() {
  cd "itsdangerous-$pkgver"

  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.rst "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
